package com.hs.sfzy.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class Article {

  private Long id;
  private String articleName;
  private String articleIntroduce;
  private Long teacherId;
  private String tabularChart;
  private String details;
  private Integer readQuantity;
  private Integer collects;
  private Long typeId;
  private Long consultId;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
  private Date createTime;
  private Articletype articletype;
  private Systemuser systemuser;


  public Article() {
  }

  public Article(Long id, String articleName, String articleIntroduce, Long teacherId, String tabularChart, String details, Integer readQuantity, Integer collects, Long typeId, Date createTime) {
    this.id = id;
    this.articleName = articleName;
    this.articleIntroduce = articleIntroduce;
    this.teacherId = teacherId;
    this.tabularChart = tabularChart;
    this.details = details;
    this.readQuantity = readQuantity;
    this.collects = collects;
    this.typeId = typeId;
    this.createTime = createTime;
  }

  /**
   * 获取
   * @return id
   */
  public Long getId() {
    return id;
  }

  /**
   * 设置
   * @param id
   */
  public void setId(Long id) {
    this.id = id;
  }

  /**
   * 获取
   * @return articleName
   */
  public String getArticleName() {
    return articleName;
  }

  /**
   * 设置
   * @param articleName
   */
  public void setArticleName(String articleName) {
    this.articleName = articleName;
  }

  /**
   * 获取
   * @return articleIntroduce
   */
  public String getArticleIntroduce() {
    return articleIntroduce;
  }

  /**
   * 设置
   * @param articleIntroduce
   */
  public void setArticleIntroduce(String articleIntroduce) {
    this.articleIntroduce = articleIntroduce;
  }

  /**
   * 获取
   * @return teacherId
   */
  public Long getTeacherId() {
    return teacherId;
  }

  /**
   * 设置
   * @param teacherId
   */
  public void setTeacherId(Long teacherId) {
    this.teacherId = teacherId;
  }

  /**
   * 获取
   * @return tabularChart
   */
  public String getTabularChart() {
    return tabularChart;
  }

  /**
   * 设置
   * @param tabularChart
   */
  public void setTabularChart(String tabularChart) {
    this.tabularChart = tabularChart;
  }

  /**
   * 获取
   * @return details
   */
  public String getDetails() {
    return details;
  }

  /**
   * 设置
   * @param details
   */
  public void setDetails(String details) {
    this.details = details;
  }

  /**
   * 获取
   * @return readQuantity
   */
  public Integer getReadQuantity() {
    return readQuantity;
  }

  /**
   * 设置
   * @param readQuantity
   */
  public void setReadQuantity(Integer readQuantity) {
    if (readQuantity == null) this.readQuantity = 0;
    else this.readQuantity = readQuantity;
  }

  /**
   * 获取
   * @return collects
   */
  public Integer getCollects() {
    return collects;
  }

  /**
   * 设置
   * @param collects
   */
  public void setCollects(Integer collects) {
    if (collects == null) this.collects = 0;
    else this.collects = collects;
  }

  /**
   * 获取
   * @return typeId
   */
  public Long getTypeId() {
    return typeId;
  }

  /**
   * 设置
   * @param typeId
   */
  public void setTypeId(Long typeId) {
    this.typeId = typeId;
  }

  /**
   * 获取
   * @return createTime
   */
  public Date getCreateTime() {
    return createTime;
  }

  /**
   * 设置
   * @param createTime
   */
  public void setCreateTime(Date createTime) {
    if (createTime == null) this.createTime = new Date();
    else this.createTime = createTime;
  }

  public String toString() {
    return "Article{id = " + id + ", articleName = " + articleName + ", articleIntroduce = " + articleIntroduce + ", teacherId = " + teacherId + ", tabularChart = " + tabularChart + ", details = " + details + ", readQuantity = " + readQuantity + ", collects = " + collects + ", typeId = " + typeId + ", createTime = " + createTime + "}";
  }
}
